﻿<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="SeachBook.aspx.cs" Inherits="SeachBook" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <br />
     <p class="title">
     检索图书
        </p>
        <hr>
    <asp:Panel ID="Panel1" runat="server" Height="136px" Width="230px">
        <table style="width: 227px; height: 147px">
            <tr>
                <td>
                    ISBN：</td>
                <td>
                    <asp:TextBox ID="txtISBN" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    书名：</td>
                <td>
                    <asp:TextBox ID="txtBookName" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    作者：</td>
                <td>
                    <asp:TextBox ID="txtAuthor" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    图书类型：</td>
                <td>
                    <asp:DropDownList ID="ddlBookType" runat="server" Width="153px">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td>
                    图书馆：</td>
                <td>
                    <asp:DropDownList ID="ddlLibrary" runat="server" Width="153px">
                        <asp:ListItem Value="MySchool">本校图书</asp:ListItem>
                        <asp:ListItem Value="OtherSchool">外校图书</asp:ListItem>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnConfirm" runat="server" Text="确定" OnClick="btnConfirm_Click" /></td>
                <td>
                    <asp:Button ID="btnCancel" runat="server" Text="取消" /></td>
            </tr>
        </table>
    </asp:Panel>
        <br />
     <p class="title">
     检索结果
        </p>
        <hr>
    <asp:Panel ID="Panel2" runat="server" Height="280px" Width="674px" HorizontalAlign="Center">
        <asp:Label ID="lbBase" runat="server" Text="图书馆名："></asp:Label>
        <asp:GridView ID="GridView1" runat="server" Height="400px"
            SkinID="GridView" Width="668px" Font-Size="9pt" AllowSorting="True" OnPageIndexChanging="GridView1_PageIndexChanging" DataKeyNames="BookID" OnRowCommand="GridView1_RowCommand">
            <AlternatingRowStyle Font-Size="12px" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
            </Columns>
            <SelectedRowStyle Font-Size="9pt" />
        </asp:GridView>
        &nbsp;
        <asp:Button ID="btnConfirm1" runat="server" Text="确定" Width="92px" OnClick="btnConfirm1_Click" PostBackUrl="~/BorrowBook.aspx" /></asp:Panel>
     <p class="title">
         图书信息
        </p>
        <hr><asp:Panel ID="Panel3" runat="server" Height="280px" Width="674px" HorizontalAlign="Center">
            <asp:DetailsView ID="DetailsView1" runat="server" Height="277px" SkinID="DetailsView"
                Width="545px" Font-Size="12pt" AutoGenerateRows="False" DataKeyNames="BookID,ClassID" DataSourceID="SqlDataSource1">
                <Fields>
                    <asp:BoundField DataField="BookID" HeaderText="BookID" ReadOnly="True" SortExpression="BookID" />
                    <asp:BoundField DataField="ISBN" HeaderText="ISBN" SortExpression="ISBN" />
                    <asp:BoundField DataField="BookName" HeaderText="BookName" SortExpression="BookName" />
                    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
                    <asp:BoundField DataField="PublishDate" HeaderText="PublishDate" SortExpression="PublishDate" />
                    <asp:BoundField DataField="BookVersion" HeaderText="BookVersion" SortExpression="BookVersion" />
                    <asp:BoundField DataField="WordCount" HeaderText="WordCount" SortExpression="WordCount" />
                    <asp:BoundField DataField="PageCount" HeaderText="PageCount" SortExpression="PageCount" />
                    <asp:BoundField DataField="Publisher" HeaderText="Publisher" SortExpression="Publisher" />
                    <asp:BoundField DataField="ClassName" HeaderText="ClassName" SortExpression="ClassName" />
                    <asp:BoundField DataField="ClassID" HeaderText="ClassID" ReadOnly="True" SortExpression="ClassID" />
                </Fields>
            </asp:DetailsView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LibraryConnectionString %>"
                SelectCommand="GetBookInfoByBookID" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="BookID" PropertyName="SelectedValue"
                        Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            &nbsp; &nbsp;
        </asp:Panel>
</asp:Content>

